from machine import ADC
import time
def estimateHoverThru():
	hoverHru = 0
	# 电池电压检测
	battery = adc.read()/ 4095* 5.02 * 0.96
	if (battery > 4.05):
		hoverHru = 400
	elif (battery > 3.90):
		hoverHru = 430
	elif (battery > 3.80):
		hoverHru = 480
	elif (battery > 3.70):
		hoverHru = 530
	else:
		hoverHru = 550
	return hoverHru
adc = ADC(15)
while(1):
	estimateHoverThru()